﻿<%@ Page Language="C#" AutoEventWireup="true" EnableEventValidation="false" CodeFile="DelData.aspx.cs"
    Inherits="DelStorage_DelData" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>正贸仓储物流管理系统</title>
    <link href="../css/css.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript">

        function fPopUpDlg(URL, Target, form)  //
        {
            if (document.getElementById('<%=txtStorageNo.ClientID %>').value == null || document.getElementById('<%=txtStorageNo.ClientID %>').value == "") {
                alert("请先输入出库单号！");
                return;
            }
            now = new Date();
            var rom;
            var rom1
            rom = Math.ceil(Math.random() * 10000);
            rom1 = now.getFullYear() + "" + now.getMonth() + "" + now.getDate() + "" + now.getHours() + "" + now.getMinutes() + "" + now.getSeconds() + "" + rom;
            //document.getElementById('<%=hidden.ClientID %>').value = window.showModalDialog("DelDataPOP.aspx?radmom=" + rom1 + "&Mtype=ADD&StorageNo=" + document.getElementById('txtStorageNo').value, window, "dialogWidth=714px;dialogHeight=200px;scroll:no;resizable:no;status:0;");
            window.open("DelDataPOP.aspx?radmom=" + rom1 + "&Mtype=ADD&StorageNo=" + document.getElementById('txtStorageNo').value, 'win', "Height=230px,Width=700px,top=180, left=500, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no");
            document.URL = location.href;
        }


        function fPopUpDlgPOP(PID)  //
        {
            now = new Date();
            var rom;
            var rom1
            rom = Math.ceil(Math.random() * 10000);
            rom1 = now.getFullYear() + "" + now.getMonth() + "" + now.getDate() + "" + now.getHours() + "" + now.getMinutes() + "" + now.getSeconds() + "" + rom;
            document.getElementById('<%=hidden.ClientID %>').value = window.showModalDialog("DelDataPOP.aspx?radmom=" + rom1 + "&Mtype=Edit&PID=" + PID, window, "dialogWidth=630px;dialogHeight=200px;scroll:no;resizable:no;status:0;");
            document.URL = location.href;
        }

        function fPopUpCalendarDlg(URL, Target, form)  //
        {
            now = new Date();
            var rom;
            var rom1
            rom = Math.ceil(Math.random() * 10000);
            rom1 = now.getFullYear() + "" + now.getMonth() + "" + now.getDate() + "" + now.getHours() + "" + now.getMinutes() + "" + now.getSeconds() + "" + rom;
            showx = event.screenX - event.offsetX - 4; // + deltaX;
            showy = event.screenY - event.offsetY + 18; // + deltaY;
           // retval = window.showModalDialog(URL + "?radmom=" + rom1, "", "dialogWidth:700px; dialogHeight:400px; dialogLeft:" + showx + "px; dialogTop:" + showy + "px; status:no; directories:yes;help:no;scrollbars:no;Resizable=no; ");
            var retval = window.open(URL, "win2", "height=400px, width=700px, top=" + showy + ", left=" + showx + ",modal=yes,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no");
            if (retval != null) {
                var Material = retval.split(",");
                //document.forms(0).txtW01.value = Material[0];           //凭证号
                document.forms(0).txtStorageNo.value = Material[1];           //单据号
                //document.forms(0).txtCDT.value = Material[2];           //单据时间
            }
        }
        
        
    </script>

    <script type="text/javascript" language="javascript">
    <!--
        function SelectAllCheckBox() {
            var form = document.forms[0];
            for (i = 0; i < form.elements.length; i++) {
                if (form.elements[i].checked == false) {
                    j = 0;
                }
                else {
                    j = 1;
                }
            } if (j == 0) {
                for (i = 0; i < form.elements.length; i++) {
                    form.elements[i].checked = true;
                }
            }
            else {
                for (i = 0; i < form.elements.length; i++) {
                    form.elements[i].checked = false;
                }
            }
        }
   
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td style="height: 30px">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td style="background-image: url(../images/tab_03.gif); background-repeat: repeat-x;
                                width: 12px;">
                                &nbsp;
                            </td>
                            <td style="background-image: url(../images/tab_05.gif); background-repeat: repeat-x;
                                height: 30px;">
                                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td style="width: 46%; vertical-align: middle;">
                                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                <tr>
                                                    <td style="width: 5%; vertical-align: middle;">
                                                        <img src="../images/tb.gif" width="16" height="16" />
                                                    </td>
                                                    <td style="width: 95%;">
                                                        <span>你当前的位置</span>：业务管理-出库单据
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                        <td width="54%">
                                        </td>
                                    </tr>
                                </table>
                            </td>
                            <td width="16" style="background-image: url(../images/tab_07.gif); height: 30px;">
                                &nbsp;
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td style="background-image: url(../images/tab_12.gif); width: 8px;">
                                &nbsp;
                            </td>
                            <td>
                                <table width="100%" border="0" cellspacing="0" cellpadding="0" style="border: 1px solid #b5d6e6;">
                                    <tr>
                                        <td style="padding: 2px;">
                                          <%-- <table width="100%" cellspacing="0" cellpadding="0" border="1" bordercolordark="#ffffff" bordercolorlight="#b5d6e6">--%>
                                            <table cellpadding="0" cellspacing="0" width="100%" style="border: 1px solid #b5d6e6;">    
                                            <tr style="height: 22px;">
                                                    <td align="right" style="width: 150px; padding-left: 2px; padding-right: 2px;">
                                                        出库单号：
                                                    </td>
                                                    <td style="width: 200px; padding-left: 2px; padding-right: 2px;">
                                                        <asp:TextBox ID="txtStorageNo" runat="server" Style="width: 150px; height: 14px;
                                                            border: solid 1px #b5d6e6; font-size: 9pt;"></asp:TextBox>
                                                        <input onclick="fPopUpCalendarDlg('DelDataListPOP.aspx','Item',form1);return false;"
                                                            src="../images/fc.gif" style="border-right: 0px; border-top: 0px; border-left: 0px;
                                                            width: 14px; border-bottom: 0px; height: 11px" type="image" />
                                                    </td>
                                                    <td align="right" style="width: 300px; padding-left: 2px; padding-right: 2px;">
                                                        出库描述：
                                                    </td>
                                                    <td style="padding-left: 2px; padding-right: 2px;">
                                                        <asp:TextBox ID="txtContents" runat="server" Style="width: 250px; height: 14px; border: solid 1px #b5d6e6;
                                                            font-size: 9pt;"></asp:TextBox>
                                                    </td>
                                                </tr>
                                                <%--<tr style="height: 22px;">
                                                    <td align="right" style="width: 150px; padding-left: 2px; padding-right: 2px;">
                                                        出库单据Excel汇入：
                                                    </td>
                                                    <td style="width: 200px; padding-left: 2px; padding-right: 2px;">
                                                        <input id="File1" type="file" runat="server" />
                                                    </td>
                                                    <td align="right" style="width: 300px; padding-left: 2px; padding-right: 2px;">
                                                        <asp:ImageButton ID="ibtn_DR" runat="server" ImageUrl="~/Images/btn/btn_DaoRu.gif"
                                                            OnClick="ibtn_DR_Click" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                        <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/DelStorage/DeliveryOrderExcel.xls"
                                                            ForeColor="Blue">下载Excel模版</asp:HyperLink>
                                                    </td>
                                                    <td style="padding-left: 2px; padding-right: 2px;">
                                                        &nbsp;
                                                        <asp:ImageButton ID="ibtn_ERP" runat="server" ImageUrl="~/Images/btn/btn_ERP.gif"
                                                            OnClick="ibtn_ERP_Click" /><asp:Label ID="lab_ERR" runat="server" Text="" ForeColor="Red"></asp:Label>
                                                    </td>
                                                </tr>--%>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr >
                                        
                                            <td style="padding: 2px" align="center">
                                            <%--<asp:ImageButton ID="ibtnxinjian" runat="server" ImageUrl="~/Images/btn/btn_xinjian.gif"
                                                OnClick="ibtnxinjian_Click" />&nbsp;--%>
                                            <asp:ImageButton ID="ibtnDelStock" runat="server" ImageUrl="~/Images/btn/btn_DelStock1.gif"
                                                OnClick="ibtnDelStock_Click" style="height: 20px" />&nbsp;&nbsp;&nbsp;&nbsp;
                                            <asp:ImageButton ID="ibtnAddList" runat="server" ImageUrl="~/Images/btn/btn_AddList1.gif"
                                                OnClientClick="fPopUpDlg()" />&nbsp;&nbsp;&nbsp;&nbsp;
                                            <asp:ImageButton ID="ibtn_Search" runat="server" ImageUrl="~/Images/btn/btn_Search1.gif"
                                                OnClick="ibtn_Search_Click" Height="20px" />&nbsp;&nbsp;&nbsp;&nbsp;
                                            <asp:ImageButton ID="ibtnRe" runat="server" Visible="false" ImageUrl="~/Images/btn/btn_re1.gif" OnClick="ibtnRe_Click" />&nbsp;

                                               
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="center" style="padding: 2px;">
                                            <div style="margin-left: 0px; margin-top: 3px; width: 100%; height: 720px; overflow-x: auto;
                                                overflow-y: auto;">
                                                <asp:GridView ID="gv" runat="server" AutoGenerateColumns="False" Width="100%" BorderWidth="1px"
                                                    BorderColor="#B5D6E6" CellPadding="0" DataKeyNames="PID"
                                                    OnRowDataBound="gv_RowDataBound">
                                                    <Columns>
                                                        <%--  <asp:TemplateField>
                                                            <HeaderTemplate>
                                                                <input id="hchkSelect" type="checkbox" onclick="SelectAllCheckBox()" />
                                                            </HeaderTemplate>
                                                            <ItemTemplate>
                                                                <asp:CheckBox ID="chkSelect" runat="server" />
                                                            </ItemTemplate>
                                                            <ItemStyle Width="5%" />
                                                        </asp:TemplateField>--%>
                                                        <asp:BoundField DataField="Mat_Code" HeaderText="物料编码"></asp:BoundField>
                                                        <asp:BoundField DataField="Mat_Name" HeaderText="物料名称"></asp:BoundField>                                                       
                                                        <asp:BoundField DataField="TS01" HeaderText="生产通知单" />
                                                         <asp:BoundField DataField="S01" HeaderText="规格"></asp:BoundField>
                                                         <asp:BoundField DataField="TM01" HeaderText="材质"></asp:BoundField>
                                                         <asp:BoundField DataField="TM03" HeaderText="长度">
                                                             <ItemStyle Width="6%" />
                                                        </asp:BoundField>
                                                           <asp:BoundField DataField="S02" HeaderText="备注">
                                                             <ItemStyle Width="10%" />
                                                        </asp:BoundField>
                                                        <asp:BoundField DataField="Unit_Base" HeaderText="单位"></asp:BoundField>
                                                        <asp:BoundField DataField="Num" HeaderText="出库数量">
                                                            <ItemStyle Width="6%" />
                                                        </asp:BoundField>
                                                        <asp:BoundField DataField="Act_Num" HeaderText="已出数量" >
                                                        <ItemStyle Width="6%" />
                                                            </asp:BoundField>
<%--                                                        <asp:TemplateField Visible="false">
                                                            <ItemTemplate>
                                                                <asp:Label ID="lbl_Mat_Code" runat="server" Text='<%# Bind("Mat_Code") %>'></asp:Label>
                                                                <asp:ImageButton ID="ibtnedit" runat="server" ImageUrl="~/Images/edt.gif" Style="height: 16px" OnClick="ibtnedit_Click" />
                                                                <asp:ImageButton ID="ibtndelete" runat="server" CommandArgument='<%#Eval("PID")%>'
                                                                    ImageUrl="~/Images/del.gif" Style="height: 16px" OnClientClick="return confirm('确定删除吗？')"
                                                                    OnClick="ibtndelete_Click" />
                                                            
                                                            </ItemTemplate>
                                                            <ItemStyle Width="8%" />
                                                        </asp:TemplateField>--%>
                                                        <asp:TemplateField HeaderText="PID" Visible="false">
                                                            <ItemTemplate>
                                                                <asp:Label ID="lbl_PID" runat="server" Text='<%# Bind("PID") %>'></asp:Label>
                                                            </ItemTemplate>
                                                            <ItemStyle Width="8%" />
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText="编辑">
                                                            <ItemTemplate>
                                                                <asp:ImageButton ID="ibtnedit" runat="server" CommandArgument='<%# Eval("PID") + "|"+Eval("StockNo")  %>' ImageUrl="~/Images/edt.gif" OnClick="ibtnedit_Click" />
                                                                 <asp:ImageButton ID="ibtndelete" runat="server" CommandArgument='<%#Eval("PID")%>'
                                                                    ImageUrl="~/Images/del.gif" Style="height: 16px" OnClientClick="return confirm('确定删除吗？')"
                                                                    OnClick="ibtndelete_Click" />
                                                            
                                                            </ItemTemplate>
                                                            <ItemStyle Width="8%" />
                                                        </asp:TemplateField>
                                                    </Columns>
                                                    <HeaderStyle HorizontalAlign="Center" CssClass="gvHeader" />
                                                    <RowStyle CssClass="gvRow" HorizontalAlign="Center" />
                                                </asp:GridView>
                                            </div>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                            <td style="background-image: url(../images/tab_15.gif); width: 8px;">
                                &nbsp;
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td style="background-image: url(../images/tab_19.gif); height: 35px;">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td style="width: 12px; height: 35px;">
                                <img src="../images/tab_18.gif" width="12" height="35" />
                            </td>
                            <td>
                                &nbsp;
                            </td>
                            <td width="16">
                                <img src="../images/tab_20.gif" width="16" height="35" />
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
        <asp:HiddenField ID="hidden" runat="server" />
    </div>
    </form>
</body>
</html>

